﻿namespace AsyncLog
{
	using System;
	using System.Runtime.InteropServices;

	internal static class NativeMethods
	{
		private const int WmVscroll = 0x115;
		private static readonly IntPtr _sbBottom = new IntPtr(7);

		[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
		private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);

		internal static void SendMessageScrollToBottom(IntPtr handle)
		{
			SendMessage(handle, WmVscroll, _sbBottom, IntPtr.Zero);
		}
	}
}